package com.cloud.api.myenum;

import com.baomidou.mybatisplus.annotation.IEnum;

import java.util.Objects;

public enum AlarmLevelEnum implements IEnum<Short> {
    ONE_LEVEL((short) 1,"一级报警"),
    TWO_LEVEL((short) 2,"二级报警"),
    THREE_LEVEL((short) 3,"三级报警");


    AlarmLevelEnum(short value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private Short value;
    private String desc;

    @Override
    public Short getValue() {
        return this.value;
    }

    public static String getDesc(Short value){
        AlarmLevelEnum[] values = AlarmLevelEnum.values();
        for (AlarmLevelEnum alarmLevelEnum : values){
            if (Objects.equals(alarmLevelEnum.value, value)){
                return alarmLevelEnum.desc;
            }
        }
        return "未知";
    }
}
